package com.itheima.test;

public class arraytest7 {
    public static void main(String[] args) {
        //定义数组，将0索引的值和最大索引进行交换
        int[] arr = {1,2,3,4,5};

        int temp = arr[0];
        arr[0] = arr[4];
        arr[4] = temp;
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
